<template>
  <el-select v-model="form.channel_id" placeholder="请选择">
    <el-option
      v-for="item in $store.state.channelsList"
      :key="item.id"
      :label="item.name"
      :value="item.id"
    >
    </el-option>
  </el-select>
</template>

<script>
import { channels } from '@/api/index.js'
export default {
  name: 'HmSelect',
  props: ['form'],
  data () {
    return { channelsList: [], selectValue: '' }
  },
  async created () {
    if (this.$store.state.channelsList.length === 0) {
      const res = await channels()
      this.$store.commit('setList', res.data.channels)
    }
  }
}
</script>

<style></style>
